main()
{
	level.tweakfile = true;
 
	// *Fog section* 

	setdvar("scr_fog_exp_halfplane", "2600");
	setdvar("scr_fog_exp_halfheight", "2649");
	setdvar("scr_fog_nearplane", "2166");
	setdvar("scr_fog_red", "0.043");
	setdvar("scr_fog_green", "0.043");
	setdvar("scr_fog_blue", "0.043");
	setdvar("scr_fog_baseheight", "1320");

	setdvar("visionstore_glowTweakEnable", "1");
	setdvar("visionstore_glowTweakRadius0", "5");
	setdvar("visionstore_glowTweakRadius1", "5");
	setdvar("visionstore_glowTweakBloomCutoff", "0.5");
	setdvar("visionstore_glowTweakBloomDesaturation", "0");
	setdvar("visionstore_glowTweakBloomIntensity0", "2");
	setdvar("visionstore_glowTweakBloomIntensity1", "2");
	setdvar("visionstore_glowTweakSkyBleedIntensity0", "0.29");
	setdvar("visionstore_glowTweakSkyBleedIntensity1", "0.29");
	
	SetSavedDvar( "sm_sunSampleSizeNear", 0.7 );

	level thread fog_settings_opening();
 
	level thread maps\_utility::set_all_players_visionset( "camp_assault_opening", 0.1 );
}

fog_settings_normal()
{
	start_dist 			= 2166;
	halfway_dist 		= 2600;
	halfway_height 	= 2649;
	base_height 		= 1320;
	red 						= 0.043;
	green 					= 0.043;
	blue		 				= 0.043;
	trans_time			= 0;
	
	SetVolFog( start_dist, halfway_dist, halfway_height, base_height, red, green, blue, trans_time );
}

fog_settings_opening()
{
	start_dist 			= 364; //729.34;
	halfway_dist 		= 485; // 971.99;
	halfway_height 	= 169; // 338.336;
	base_height 		= 199; // 398.623;
	red 						= 0.043;
	green 					= 0.043;
	blue		 				= 0.043;
	trans_time			= 0;
	
	SetVolFog( start_dist, halfway_dist, halfway_height, base_height, red, green, blue, trans_time );
}

visionChange_Bridge()
{
	level waittill ( "vision_bridge" );
	println( "Vision changing to bridge..." );
	VisionSetNaked( "camp_assault_bridge", 8 );
}

lerpDvar( dvar, value, time )
{
//	dvar_OrigValue = GetDvar( dvar );
//	dvar_OrigValue = float( dvar_OrigValue );
//	
//	frames = int( time * 20 );
//	increment = ( value - dvar_OrigValue ) / frames;
//	dvar_CurValue = dvar_OrigValue;
//	
//	lerpDvarOnPlayers( dvar, dvar_CurValue, value, increment );
}

lerpDvarOnPlayers( dvar, dvar_CurValue, dvar_NewValue, increment )
{
//	players = get_players();
//	
//	for( y = 0 ; y < frames ; y++ )
//	{
//		wait( 0.05 );
//		dvar_CurValue += increment;
//		player SetClientDvar( dvar, dvar_CurValue );
//	}
//	
//	player SetClientDvar( dvar, dvar_NewValue );
}